package com.example.apliktec;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.view.View;

public class Eventos extends Activity {
	int notificationID = 1;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_eventos);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.eventos, menu);
		return true;
	}
	
	public void onClick_btnDisplayNotif(View view){	
		DisplayNotification();
	}	
	protected void DisplayNotification(){
	
	Intent i = new Intent ("com.example.apliktec.Notificacion");
	i.putExtra("notificationID",notificationID);
	
	PendingIntent pendingIntent =
			PendingIntent.getActivity(this, 0, i, 0);
	
	NotificationManager nm = (NotificationManager)
			getSystemService(NOTIFICATION_SERVICE);
	
	Notification notif = new Notification(
			R.drawable.apli1,
			"Entrega del Proyecto de Ing.Rivalcoba",
			System.currentTimeMillis());
	
	CharSequence from = "AplikTec te anuncia";
	CharSequence message = "Entrega del Proyecto de Ing.Rivalcoba";
	
	notif.setLatestEventInfo(this, from, message, pendingIntent);
	notif.vibrate = new long[]{100,250,100,500};
	nm.notify(notificationID,notif);
	
	}

}